<?php


include_once($ctx->cfgPath('lib').'cms/cmsTTreeView.o.inc.php');

class cmsTreeView extends cmsTTreeView
{

  function __construct ($data,&$s_open_cat,$open_cat,$home_id)
  {
     cmsTTreeView::__construct($data,$s_open_cat,$open_cat);
     $this->home_id = $home_id;
  }

  function generateLink(&$ds)
  {
    global $cfgPaths,$env;
    $ds_name = $ds['name'];
    if ($ds['type']=='folder')
      $str =  ' '.$ds['name'];
    else
    {
      $str  =  ' <a class="treeview" title="id: '.$ds['id'].', weight: '.$ds['weighting'].'" href="'.$this->init_data['link'].'?doc_id='.$ds['id'].'" target="page">';
      $ds_name = ($ds['id']==$this->home_id)?'<b>'.$ds_name.'</b>':$ds_name;
      $str .= ($ds['id']==$env->param('doc_id'))?'<i>'.$ds_name.'</i>':$ds_name;
      $str .= '</a>';
    }
    return $str;
  }
  
}


?>
